<template>
  <el-dialog
    :title="title||'支付成功'"
    :visible.sync="dialogVisible"
    :close-on-click-modal="false"
    @close="close"
    width="620px"
    append-to-body
  >
    <div class="form-box">
      <img src="https://imgage.maimaihao.com/yuduhulian/erp/static/img/pay-success.png" alt=""><br/>
      <span class="font22">{{tip||'支付成功！'}}</span>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      dialogVisible: false,
      loading: false,
      title: "充值虞豆",
      tip:'',
      reload:false
    };
  },
  created() {
  },
  methods: {
    // 打开弹窗
    open(successTit,successTip,reload=false) {
      this.reload = reload
      this.title = successTit
      this.tip =successTit + successTip + ',刷新页面后生效'
      this.dialogVisible = true;
    },
    close() {
      if(localStorage.getItem('serverIndex')) {
         this.dialogVisible = false;
         this.$emit('init')
        return
      }
      if(this.reload){
         location.reload();
      }
      this.dialogVisible = false;
    },
  },
};
</script>
<style scoped lang="scss">
.form-box {
  text-align: center;
  color: $primary;
  img{
    width: 90px;
    margin-bottom: 30px;
  }
}
</style>
